package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Diningdescriptionlist;
import com.ean.backpack.repository.DiningdescriptionlistRepository;
import com.ean.backpack.service.DiningdescriptionlistService;

@Service
@Transactional
public class DiningdescriptionlistServiceImpl implements
		DiningdescriptionlistService {

	@Autowired
	DiningdescriptionlistRepository diningdescriptionlistRepository;

	public long countAllDiningdescriptionlists() {
		return diningdescriptionlistRepository.count();
	}

	public void deleteDiningdescriptionlist(
			Diningdescriptionlist diningdescriptionlist) {
		diningdescriptionlistRepository.delete(diningdescriptionlist);
	}

	public Diningdescriptionlist findDiningdescriptionlist(Integer id) {
		return diningdescriptionlistRepository.findOne(id);
	}

	public List<Diningdescriptionlist> findAllDiningdescriptionlists() {
		return diningdescriptionlistRepository.findAll();
	}

	public List<Diningdescriptionlist> findDiningdescriptionlistEntries(
			int firstResult, int maxResults) {
		return diningdescriptionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveDiningdescriptionlist(
			Diningdescriptionlist diningdescriptionlist) {
		diningdescriptionlistRepository.save(diningdescriptionlist);
	}

	public Diningdescriptionlist updateDiningdescriptionlist(
			Diningdescriptionlist diningdescriptionlist) {
		return diningdescriptionlistRepository.save(diningdescriptionlist);
	}
}
